package com.xjh.basestudy.javabase.thread.runnable;

public class TestRunnable {
    public static void main(String[] args) {
        MyRunnable  my = new MyRunnable();
        //创建Thread类的对象，把MyRunnable对象作为构造方法的参数
        Thread t1 = new Thread(my,"高铁");//名称可写可不写
        Thread t2 = new Thread(my,"飞机");
        //启动线程
        t1.start();
        t2.start();
    }
}
